from functools import reduce

t1 = lambda agr1,arg2 : agr1 + arg2




# lamda表达式通常与 map  filter reduce  一起使用  reduce是代表累积相加
list1 = [1,2,3,4,5]
map_t1 = list(map(lambda param : param,list1))
filter_t1 = list(filter(lambda param : param % 2 == 0,list1))
# param为上一次执行以后返回的结果  param2是下一个结果
reduce_t1 = reduce(lambda param,param2 : param2 * param,list1)











if __name__ == '__main__':
    # print(map_t1)
    # print(filter_t1)
    # print(reduce_t1)
    #
    # print(id(list1))
    # print(id(list(list1)))
    a = [1,2,3,4,43,2]
    b = [x for x in a]
    print(b)
    b1 = [[x,x**2] for x in a]
    print(b1)